<?php defined('SYSPATH') or die('No direct script access.');

class Model_Dao_ClinicalInformation extends ORM{

	protected $_table_name  = 'clinical_information'; // default: accounts
    protected $_primary_key = 'id';      // default: id
    protected $_primary_val = 'information_date';      // default: name (column used as primary value)
    
	// default for $_table_columns: use db introspection to find columns and info
    // see http://v3.kohanaphp.com/guide/api/Database_MySQL#list_columns for all possible column attributes
    protected $_table_columns = array(
        'id'   => array('data_type' => 'int',    'is_nullable' => FALSE),
    	'information_date' => array('data_type' => 'date',    'is_nullable' => TRUE), 
        'height'  => array('data_type' => 'int', 'is_nullable' => TRUE),
    	'weight' => array('data_type'=>'float', 'is_nullable' => TRUE),
    	'observations' =>  array('data_type'=>'string', 'is_nullable' => TRUE),
    	'total_cholesterol' => array('data_type'=>'float', 'is_nullable' => TRUE),
    	'hdl'=> array('data_type'=>'float', 'is_nullable' => TRUE),
    	'ldl'=> array('data_type'=>'float', 'is_nullable' => TRUE),
    	'triglycerides' => array('data_type'=>'float', 'is_nullable' => TRUE),
    	'glucemic' => array('data_type'=>'float', 'is_nullable' => TRUE),
    	'systolic_pressure' => array('data_type'=>'float', 'is_nullable' => TRUE),
    	'diastolic_pressure'=> array('data_type'=>'float', 'is_nullable' => TRUE),
    	'patient_id'=> array('data_type'=>'int', 'is_nullable' => TRUE),
    	'age'=> array('data_type'=>'int', 'is_nullable' => TRUE)
    );
    
    //Relacion
	protected $_belongs_to = array('patient' => array('model' => 'dao_patient', 'foreign_key'=>'patient_id'));

}?>




         
